package nl.mkmedia.tuio.behaviours {
	import nl.mkmedia.tuio.TUIOPoint;
	import flash.display.DisplayObject;

	/**
	 * @author Mingoes Kukupessy (mingoes at gmail dot com)
	 */
	public class BaseBehaviour implements IBehaviour {
		
		public var displayObject : DisplayObject;
		public var points : Array;
		public var pointsOn : Array;
		
		public function BaseBehaviour(displayObject : DisplayObject)
		{
			this.displayObject = displayObject;
		}

		public function act(points : Array) : void
		{
			this.displayObject = displayObject;
			this.points = points;
			findPointsOnObject();
		}
		
		public function findPointsOnObject() : void
		{
			pointsOn = new Array();
			for each (var point : TUIOPoint in points) {
				if(displayObject.hitTestPoint(point.x, point.y)) pointsOn.push(point);
			}
		}

	}
}
